473,465 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

link to another page with button

Can I link to another page with a <input type=button> without javascript???

Thanks
Jul 20 '05 #1
10 100457
" wrote:
Can I link to another page with a <input type=button> without
javascript???


What do you actually want to achieve?
Form buttons are there to submit forms. If you want to link to another
site, you use <a ...></a>. You can style the link to look like a
button, though.

--
Google Blogoscoped
http://blog.outer-court.com
Jul 20 '05 #2
MH
> Can I link to another page with a <input type=button> without
javascript???

Yes, you can;

<FORM action="page.htm"><INPUT type=submit value="whateverbuttontext"><a
href="page.htm" ></a></FORM>

-------
MH
Jul 20 '05 #3
"MH" <no****@nowhere.no> schrieb im Newsbeitrag
news:bs**********@news1.tilbu1.nb.home.nl...
Can I link to another page with a <input type=button> without

javascript???

Yes, you can;

<FORM action="page.htm"><INPUT type=submit value="whateverbuttontext"><a
href="page.htm" ></a></FORM>

-------
MH


What is the reason for the empty link?

<FORM action="page.htm">
<INPUT type=submit value="whateverbuttontext">
</FORM>

should do it anyway?

--
Markus
Jul 20 '05 #4
MH
> > <FORM action="page.htm"><INPUT type=submit value="whateverbuttontext"><a
href="page.htm" > </a></FORM>
What is the reason for the empty link?
I cut&pasted the example out of a page I made. Next to the button was a
small clickable image link to the same 'page.htm', like;
FORM action="page.htm">
INPUT type=submit value="whateverbuttontext">
<a href="page.htm" ><img src="image,.jpg" alt="..."></a>
/FORM>

For the example I deleted the 'img' bit and forgot to delete the 'href'
<FORM action="page.htm">
<INPUT type=submit value="whateverbuttontext">
</FORM>
should do it anyway?


Yes, correct,
and if you want 'page.htm' to open in a new window you can add 'target
="_blank"' to the FORM part;

<FORM action="page.htm" target="_blank">
<INPUT type=submit value="whateverbuttontext">
</FORM>

--------
MH
Jul 20 '05 #5
In article <bs**********@nic.grnet.gr>, ch******@hotmail.NOSPAM.com
says...
Can I link to another page with a <input type=button> without javascript???

Thanks


Bonus suggestion, if you want to use an image button rather than the
default one, plus pass hidden variables to the target page:

<form action="target_page.php" method="post">
<input type=hidden name=optional_parameter value=something_if_want>
<input type=image src="imagedirectory/custom_button.gif">
</form>

Geoff M
Jul 20 '05 #6
On Tue, 23 Dec 2003, Geoff Muldoon wrote:
Bonus suggestion, if you want to use an image button rather than the
default one, plus pass hidden variables to the target page: [..] <input type=image src="imagedirectory/custom_button.gif">


If you're going to apply for the bonus, at least your answer should be
reasonably complete!

1: don't forget an alt= attribute, for the use of text browsers

2: don't forget to remind the O.P about the special form of the
submitted parameters (clue: .x and .y) when input type=image is used.

cheers
Jul 20 '05 #7
On Mon, 22 Dec 2003, Markus Ernst wrote:
"MH" <no****@nowhere.no> schrieb im Newsbeitrag
news:bs**********@news1.tilbu1.nb.home.nl...
Can I link to another page with a <input type=button> without

javascript???

Yes, you can;

<FORM action="page.htm"><INPUT type=submit value="whateverbuttontext"><a
href="page.htm" ></a></FORM>


What is the reason for the empty link?

<FORM action="page.htm">
<INPUT type=submit value="whateverbuttontext">
</FORM>

should do it anyway?


I don't know if the above code would work, but if one can do it with a FORM
construct, shouldn't one explicitly add "METHOD=GET" to it? Some browser
clients might default to PUT or POST without it - since those are more commonly
used with form constructs.
Jul 20 '05 #8
"D. Stussy" <kd****@bde-arc.ampr.org> schrieb im Newsbeitrag
news:Pi******************************@kd6lvw.ampr. org...
On Mon, 22 Dec 2003, Markus Ernst wrote:
"MH" <no****@nowhere.no> schrieb im Newsbeitrag
news:bs**********@news1.tilbu1.nb.home.nl...
> Can I link to another page with a <input type=button> without
javascript???

Yes, you can;

<FORM action="page.htm"><INPUT type=submit value="whateverbuttontext"><a href="page.htm" ></a></FORM>
What is the reason for the empty link?

<FORM action="page.htm">
<INPUT type=submit value="whateverbuttontext">
</FORM>

should do it anyway?


I don't know if the above code would work, but if one can do it with a

FORM construct, shouldn't one explicitly add "METHOD=GET" to it? Some browser
clients might default to PUT or POST without it - since those are more commonly used with form constructs.


I think as long as you don't pass any additional data the server will not
care about the method. Actually there is no reason to use a form in this
case anyway, as buttons usually do not look nicer than a normal link. But
that was not the question ;-)

--
Markus
Jul 20 '05 #9
On Wed, 24 Dec 2003, Markus Ernst wrote:
"D. Stussy" <kd****@bde-arc.ampr.org> schrieb im Newsbeitrag
news:Pi******************************@kd6lvw.ampr. org...
On Mon, 22 Dec 2003, Markus Ernst wrote:
"MH" <no****@nowhere.no> schrieb im Newsbeitrag
news:bs**********@news1.tilbu1.nb.home.nl...
> > Can I link to another page with a <input type=button> without
> javascript???
>
> Yes, you can;
>
> <FORM action="page.htm"><INPUT type=submit value="whateverbuttontext"><a > href="page.htm" ></a></FORM>

What is the reason for the empty link?

<FORM action="page.htm">
<INPUT type=submit value="whateverbuttontext">
</FORM>

should do it anyway?


I don't know if the above code would work, but if one can do it with a

FORM
construct, shouldn't one explicitly add "METHOD=GET" to it? Some browser
clients might default to PUT or POST without it - since those are more

commonly
used with form constructs.


I think as long as you don't pass any additional data the server will not
care about the method. Actually there is no reason to use a form in this
case anyway, as buttons usually do not look nicer than a normal link. But
that was not the question ;-)


Not true. Apache (apparently the most popular, so they claim) cares. One can
limit access to resources by method - so if a wrong method is chosen, access is
denied. I don't know (or really care) about others, including M$ IIS.
Jul 20 '05 #10
MH
> > <FORM action="page.htm">
<INPUT type=submit value="whateverbuttontext">
</FORM>
should do it anyway?
I don't know if the above code would work
Yes, it does work and validates as html 4,01
but if one can do it with a FORM
construct, shouldn't one explicitly add "METHOD=GET" to it?


Yes you could, but GET is the default method
If the 'page.htm' is given as URI http://www........../page.htm , POST will
not work ---> 404, though the example given at
http://www.w3.org/TR/html401/interact/forms.html shows the use of POST )

<FORM METHOD="get" action="http://www....../page.htm">
<INPUT type="submit" value="whateverbuttontext">
</FORM>
Jul 20 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: -DRB- | last post by:
Hi, I'm probably going to get harassed just for mentioning the unmentionable, but since I have if anyone could answer this question that would be much appreciated. As per the rather long...
6
by: anon | last post by:
Post Forwarding question...... For this control below, <asp:Button runat="server" PostTargetUrl="page2.aspx" /> The Attribute: PostTargetUrl="page2.aspx" Is this PostTargetUrl Attribute...
1
by: Simon Wigzell | last post by:
I have a form with several different submit buttons that does different thinkgs depending which button is clicked. (All the submit buttons are named "Submit" and my form uses the asp...
1
by: GTDriver | last post by:
I'm trying to determine how to create a page with data from the database and I want to use the link button to have the user click on. Once the user clicks on the link button I want to transfer...
1
by: czi02 | last post by:
Hi there;;; Does anybody out there knows how to create another page or link with?? First, I had a page name image.htm and saved it on my shared files My html goes like this ...
9
by: dwaszak | last post by:
Hi, I have a lot of links in my app ( normal <a href="http://...">some_text</a). I would like to change CSS style of this links, so that they look like normal button (like plain <input...
2
by: manishamca | last post by:
in html we go another page by using this <form action="one.html"> but i have to do go to another page after clciking a button....ie if i click different buttons the ni shuld go to...
12
Decahedron
by: Decahedron | last post by:
how do I get a button to open another page - I have this <button type="button">Buggy Whipp Bio</button> i need it to bring a user to buggy whipp bio.html Any help would be appreciated
1
by: abcdriver | last post by:
Later edit: Too complex: The only thing I should know is: The submit button's NAME (and value) will only be sent if that particular button was used to submit the form, so you should be able to...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.